package com.s_statusbar;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.s7.statusbar.StatusBarCompat;
import com.s7.statusbar.utils.StatusBarUtils;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn, btn1, btn2, btn3, btn4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn = findViewById(R.id.btn);
        btn1 = findViewById(R.id.btn1);
        btn2 = findViewById(R.id.btn2);
        btn3 = findViewById(R.id.btn3);
        btn4 = findViewById(R.id.btn4);
        btn.setOnClickListener(this);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
        btn4.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn:
               startActivity(new Intent(MainActivity.this, DesignActivity.class));
                break;
            case R.id.btn1:
                StatusBarCompat.translucentStatusBar(this, true);
                break;
            case R.id.btn2:
                StatusBarCompat.translucentStatusBar(this, false);
                break;
            case R.id.btn3:
                StatusBarCompat.setStatusBarColor(this, Color.BLUE);
                break;
            case R.id.btn4:
                startActivity(new Intent(MainActivity.this, DetailsActivity.class));
                break;
        }
    }
}
